import { Controller, Get, Post, Body } from '@nestjs/common';
import { FilmsService } from './films.service';
import { CreateDto } from './dto/create.dto';
import { UpdateDto } from './dto/update.dto.';
import { Non0Params } from '@/customDecorator';
@Controller('films')
export class FilmsController {
  constructor(private filmsService: FilmsService) {}

  @Post('/createFilm')
  createFilm(@Body() createDto: CreateDto) {
    console.log('createDto: ', createDto);
    return this.filmsService.createFilm(createDto);
  }

  @Get()
  getFilmList(@Non0Params() query) {
    return this.filmsService.getFilmList(query);
  }

  @Post('/updateFilm')
  updateFilm(@Body() req: UpdateDto) {
    return this.filmsService.updateFilm(req);
  }

  @Post('/deleteFilm')
  deleteFilm(@Body() req) {
    return this.filmsService.deleteFilm(req);
  }
}
